package cn.edu.nju.software.bean.show;

import cn.edu.nju.software.bean.storage.Category;

public class CategoryShow {

	private int categoryID;
	private String name;
	private CategoryShow fatherCategory;

	public CategoryShow(Category category, CategoryShow fatherCategory) {
		if (category != null) {
			this.categoryID = category.getCategoryID();
			this.name = category.getName();
		}
		this.fatherCategory = fatherCategory;
	}

	public int getCategoryID() {
		return categoryID;
	}

	public void setCategoryID(int categoryID) {
		this.categoryID = categoryID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public CategoryShow getFatherCategory() {
		return fatherCategory;
	}

	public void setFatherCategory(CategoryShow fatherCategory) {
		this.fatherCategory = fatherCategory;
	}

	public Category getCategory() {
		return new Category(categoryID, name, fatherCategory.getCategoryID());
	}

}
